package com.desiy.controller;

import com.desiy.entity.Admin;
import com.desiy.entity.User;
import com.desiy.service.UserService;
import com.desiy.utils.MsgData;
import com.desiy.utils.ResponseDTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;

/**
 * @author Desiy
 * @date 2020/9/18 15:02
 */
@RestController
@CrossOrigin
public class UserController {

    // LoggerFactory 取代System.out.println()
    private static Logger logger = LoggerFactory.getLogger(LoginController.class);

    @Autowired
    UserService userService;

    @RequestMapping("/listAll")
    public Collection<User> listAll(){
        Collection<User> users = userService.queryList();
        return users;
    }


}
